<?php

//if form submit 
if (!empty($_POST)) {
    //upload ảnh	
    if ($_FILES['img']['name'] != '') {
        $image_name = "pro_" . $pid;
        $configImg = array(
            'name' => $image_name,
            'upload_path' => './public/products/imgs/',
            'allowed_exts' => 'jpg|jpeg|png|gif',
            'type' => 'image'
        );
        $image = upload('img', $configImg);
    }
}


